package SellCar.service.impl;

import java.util.List;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import SellCar.dao.sell.SellMapper;
import SellCar.dao.sell.impl.SellMapperImpl;
import SellCar.pojo.Buy;
import SellCar.pojo.Sell;
import SellCar.service.SellBiz;
@Service("sellBizImpl")
public class SellBizImpl implements SellBiz {
	@Autowired
	@Qualifier("sellMapperImpl")
	private SellMapperImpl sellMapperImpl;
	//添加数据方法
	public Integer addInfo(String carName, String year, Integer price,
			String particulars, String image) {
		return sellMapperImpl.addInfo(carName, year, price, particulars, image);
	}
	
	//通过添加的数据，查询总数据返显的方法
	public List<Sell> showSellInfo(String carName, String year,
			Integer price, String particulars, String image) {
		return sellMapperImpl.showSellInfo(carName, year, price, particulars, image);
	}

	/*@Test
	public void test(){
		ApplicationContext ap = new ClassPathXmlApplicationContext("applicationContext.xml");
		SellBizImpl sellBizImpl = (SellBizImpl) ap.getBean("sellBizImpl");
		List<Sell> list = sellBizImpl.showSellInfo("����Ұ��", "2018-8-22", 600000, "��������", "ͼƬ");
		for (Sell sell : list) {
			System.out.println(sell.getYear());
		}
	}*/
}
